package com.group4.statistics.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.group4.statistics.entity.Daily;
import com.group4.statistics.mapper.DailyMapper;
import com.group4.statistics.service.DailyService;
import com.study.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author cloud
 * @since 2022-03-10
 */
@RestController
@CrossOrigin
@RequestMapping("/statistics/daily")
public class DailyController {
    @Autowired
    private DailyService dailyService;
    @Autowired
    private DailyMapper dailyMapper;

    /**
     * 查询所有数据
     * @return
     */
    @GetMapping("all")
    public ResponseResult<List<Daily>> all(){
        QueryWrapper<Daily> qw = new QueryWrapper<>();
        List<Daily> dailies = dailyMapper.selectList(qw);
        return new ResponseResult<>(dailies);
    }
}

